package com.demo2do.fms.entity.driver;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type;
import org.springframework.format.annotation.DateTimeFormat;

import com.demo2do.core.format.PersistentFormat;
import com.demo2do.fms.entity.authority.Organization;
import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * 司机信息  已合并
 *
 * @author Ark
 *
 */
@Entity
@Table(name = "TBL_ALL_EMPLOYEE_INFO")
@PersistentFormat
public class Employee {

    @Id
    @GeneratedValue(generator = "generator")
    @GenericGenerator(name = "generator", strategy = "assigned")
    private Long id;

    /** 姓名 */
    private String name;

    /** 性别 */
    private String gender;

    /** 工号 */
    @Column(name = "employee_code")
    private String code;

    /** 身份证号 */
    @Column(name = "citizen_code")
    private String citizenCode;

    /** 生日 */
    @Type(type = "")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date birthday;

    /** 职务ID */
    @Column(name = "duty_id")
    private Long dutyId;

    /** 车辆ID */
    private Long vehicleId;

    /**
     * 手机号码
     */
    private String mp;

    /**
     * 公司名称
     */
    @ManyToOne(fetch = FetchType.LAZY, optional = true)
    @JoinColumn(name = "organization_id", referencedColumnName = "id")
    @PersistentFormat
    @JsonIgnore(value = true)
    private Organization organization;

    /** 是否激活 */
    @Column(name = "is_active")
    private Boolean active;
    
    @Column(name = "is_disabled")
    private Boolean disabled;

    /**
     * 教育程度
     */
    private Long educationLevel;

    /**
	 * 政治面貌
     * CLAN_ID
     */
    private Long clanId;

    /**
     * JOIN_DATE
     */
    @Type(type = "")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date joinDate;

    /**
     * 学校
     */
    private String school;

    /**
     * 毕业时间
     */
    @Type(type = "")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date graduateDate;

    /**
	 * 专业
     * SPECIALITY
     */
    private String speciality;

    /**
	 * 学位
     * DEGREE_ID
     */
    private Long degreeId;

    /**
     * HOME_ADDRESS
     */
    private String homeAddress;

    /**
     * 通讯地址
     */
    private String contactAddress;

    /**
     * 住址邮政编码
     */
    private String homeZipcode;

    /**
     * 通讯地址邮政编码
     */
    private String contactZipcode;

    /**
     * CONTACTOR_NAME
     */
    private String contactorName;

    /**
     * CONTACTOR_APPELLATION
     */
    private String contactorAppellation;

    /**
     * 电话
     */
    private String tel;

    /**
     * DESCRIPTION
     */
    private String description;

    /**
     * 创建时间
     */
    @Type(type = "")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createDate;

    /**
     * 最后修改时间
     */
    @Type(type = "")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date lastModifyDate;

    /**
     * 创建ID
     */
    private Long creatorId;

    /**
     * 最后操作ID
     */
    private Long lastOperatorId;

    /**
     * 部门ID
     */
    private Long departmentId;

    /**
     * HR_STATUS
     */
    private Long hrStatus;

    /**
     * BOARD_DATE
     */
    @Type(type = "")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date boardDate;

	/**
	 * 供应商Id
	 */
	private Long supplierId;

	/**
	 * 驾龄
	 */
	private Long drivingAge;

	/**
	 * 劳务合同签署方
	 */
	private String contractParty;

	/**
	 * 准驾车型
	 */
	private String drivingType;

	/**
	 * 身份证正面
	 */
	private String idFrontPhoto;

	/**
	 * 身份证背面
	 */
	private String idBackPhoto;

	/**
	 * 驾照原件
	 */
	private String license;

	/**
	 * 第三方验证
	 */
	private String thirdAuthentication;

	/**
	 * 正面免冠照
	 */
	private String avatar;

	/**
	 * 审核状态
	 */
	@Enumerated(EnumType.STRING)
	private DriverAuditStatus status;

	/**
	 * 是否DVL
	 */
	private Boolean isDvl;

	/**
	 * DVL修改时间
	 */
	@Type(type = "")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date DvlLastUpdateDate;

	/**
	 * Instantiates a new Employee.
	 */
	public Employee() {
    }

	/**
	 * init
	 *
	 * @return employee
	 */
	public Employee init() {
        this.creatorId = (long) 3809296;
        this.lastOperatorId = (long) 3809265;
        this.createDate = new Date();
        this.lastModifyDate = this.createDate;
        this.disabled = false;
        this.active = true;
        this.hrStatus = (long) 0;
        this.boardDate = new Date();
        this.departmentId = (long) 0;
        return this;
    }

	/**
	 * Change statue employee.
	 *
	 * @return the employee
	 */
	public Employee changeStatue() {
        this.disabled = true;
        return this;
    }

    /**
     * @return the id
     */
    public Long getId() {
        return id;
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @return the gender
     */
    public String getGender() {
        return gender;
    }

    /**
     * @return the code
     */
    public String getCode() {
        return code;
    }

    /**
     * @return the citizenCode
     */
    public String getCitizenCode() {
        return citizenCode;
    }

    /**
     * @return the birthday
     */
    public Date getBirthday() {
        return birthday;
    }

    /**
     * @return the dutyId
     */
    public Long getDutyId() {
        return dutyId;
    }

    /**
     * @return the vehicleId
     */
    public Long getVehicleId() {
        return vehicleId;
    }

    /**
     * @return the mp
     */
    public String getMp() {
        return mp;
    }

    /**
     * @return the organization
     */
    public Organization getOrganization() {
        return organization;
    }

    /**
     * @return the active
     */
    public Boolean getActive() {
        return active;
    }

    /**
     * @return the disabled
     */
    public Boolean getDisabled() {
        return disabled;
    }

    /**
     * @return the educationLevel
     */
    public Long getEducationLevel() {
        return educationLevel;
    }

    /**
     * @return the clanId
     */
    public Long getClanId() {
        return clanId;
    }

    /**
     * @return the joinDate
     */
    public Date getJoinDate() {
        return joinDate;
    }

    /**
     * @return the school
     */
    public String getSchool() {
        return school;
    }

    /**
     * @return the graduateDate
     */
    public Date getGraduateDate() {
        return graduateDate;
    }

    /**
     * @return the speciality
     */
    public String getSpeciality() {
        return speciality;
    }

    /**
     * @return the degreeId
     */
    public Long getDegreeId() {
        return degreeId;
    }

    /**
     * @return the homeAddress
     */
    public String getHomeAddress() {
        return homeAddress;
    }

    /**
     * @return the contactAddress
     */
    public String getContactAddress() {
        return contactAddress;
    }

    /**
     * @return the homeZipcode
     */
    public String getHomeZipcode() {
        return homeZipcode;
    }

    /**
     * @return the contactZipcode
     */
    public String getContactZipcode() {
        return contactZipcode;
    }

    /**
     * @return the contactorName
     */
    public String getContactorName() {
        return contactorName;
    }

    /**
     * @return the contactorAppellation
     */
    public String getContactorAppellation() {
        return contactorAppellation;
    }

    /**
     * @return the tel
     */
    public String getTel() {
        return tel;
    }

    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    /**
     * @return the createDate
     */
    public Date getCreateDate() {
        return createDate;
    }

    /**
     * @return the lastModifyDate
     */
    public Date getLastModifyDate() {
        return lastModifyDate;
    }

    /**
     * @return the creatorId
     */
    public Long getCreatorId() {
        return creatorId;
    }

    /**
     * @return the lastOperatorId
     */
    public Long getLastOperatorId() {
        return lastOperatorId;
    }

    /**
     * @return the departmentId
     */
    public Long getDepartmentId() {
        return departmentId;
    }

    /**
     * @return the hrStatus
     */
    public Long getHrStatus() {
        return hrStatus;
    }

    /**
     * @return the boardDate
     */
    public Date getBoardDate() {
        return boardDate;
    }

    /**
     * @return the 

     */
    public Long getSupplierId() {
        return supplierId;
    }

    /**
     * @return the drivingAge
     */
    public Long getDrivingAge() {
        return drivingAge;
    }

    /**
     * @return the contractParty
     */
    public String getContractParty() {
        return contractParty;
    }

    /**
     * @return the drivingType
     */
    public String getDrivingType() {
        return drivingType;
    }

    /**
     * @return the idFrontPhoto
     */
    public String getIdFrontPhoto() {
        return idFrontPhoto;
    }

    /**
     * @return the idBackPhoto
     */
    public String getIdBackPhoto() {
        return idBackPhoto;
    }

    /**
     * @return the license
     */
    public String getLicense() {
        return license;
    }

    /**
     * @return the thirdAuthentication
     */
    public String getThirdAuthentication() {
        return thirdAuthentication;
    }

    /**
     * @return the avatar
     */
    public String getAvatar() {
        return avatar;
    }

    /**
     * @return the status
     */
    public DriverAuditStatus getStatus() {
        return status;
    }

    /**
     * @return the isDvl
     */
    public Boolean getIsDvl() {
        return isDvl;
    }

    /**
     * @return the dvlLastUpdateDate
     */
    public Date getDvlLastUpdateDate() {
        return DvlLastUpdateDate;
    }

    /**
     * @param id the id to set
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @param gender the gender to set
     */
    public void setGender(String gender) {
        this.gender = gender;
    }

    /**
     * @param code the code to set
     */
    public void setCode(String code) {
        this.code = code;
    }

    /**
     * @param citizenCode the citizenCode to set
     */
    public void setCitizenCode(String citizenCode) {
        this.citizenCode = citizenCode;
    }

    /**
     * @param birthday the birthday to set
     */
    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    /**
     * @param dutyId the dutyId to set
     */
    public void setDutyId(Long dutyId) {
        this.dutyId = dutyId;
    }

    /**
     * @param vehicleId the vehicleId to set
     */
    public void setVehicleId(Long vehicleId) {
        this.vehicleId = vehicleId;
    }

    /**
     * @param mp the mp to set
     */
    public void setMp(String mp) {
        this.mp = mp;
    }

    /**
     * @param organization the organization to set
     */
    public void setOrganization(Organization organization) {
        this.organization = organization;
    }

    /**
     * @param active the active to set
     */
    public void setActive(Boolean active) {
        this.active = active;
    }

    /**
     * @param disabled the disabled to set
     */
    public void setDisabled(Boolean disabled) {
        this.disabled = disabled;
    }

    /**
     * @param educationLevel the educationLevel to set
     */
    public void setEducationLevel(Long educationLevel) {
        this.educationLevel = educationLevel;
    }

    /**
     * @param clanId the clanId to set
     */
    public void setClanId(Long clanId) {
        this.clanId = clanId;
    }

    /**
     * @param joinDate the joinDate to set
     */
    public void setJoinDate(Date joinDate) {
        this.joinDate = joinDate;
    }

    /**
     * @param school the school to set
     */
    public void setSchool(String school) {
        this.school = school;
    }

    /**
     * @param graduateDate the graduateDate to set
     */
    public void setGraduateDate(Date graduateDate) {
        this.graduateDate = graduateDate;
    }

    /**
     * @param speciality the speciality to set
     */
    public void setSpeciality(String speciality) {
        this.speciality = speciality;
    }

    /**
     * @param degreeId the degreeId to set
     */
    public void setDegreeId(Long degreeId) {
        this.degreeId = degreeId;
    }

    /**
     * @param homeAddress the homeAddress to set
     */
    public void setHomeAddress(String homeAddress) {
        this.homeAddress = homeAddress;
    }

    /**
     * @param contactAddress the contactAddress to set
     */
    public void setContactAddress(String contactAddress) {
        this.contactAddress = contactAddress;
    }

    /**
     * @param homeZipcode the homeZipcode to set
     */
    public void setHomeZipcode(String homeZipcode) {
        this.homeZipcode = homeZipcode;
    }

    /**
     * @param contactZipcode the contactZipcode to set
     */
    public void setContactZipcode(String contactZipcode) {
        this.contactZipcode = contactZipcode;
    }

    /**
     * @param contactorName the contactorName to set
     */
    public void setContactorName(String contactorName) {
        this.contactorName = contactorName;
    }

    /**
     * @param contactorAppellation the contactorAppellation to set
     */
    public void setContactorAppellation(String contactorAppellation) {
        this.contactorAppellation = contactorAppellation;
    }

    /**
     * @param tel the tel to set
     */
    public void setTel(String tel) {
        this.tel = tel;
    }

    /**
     * @param description the description to set
     */
    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * @param createDate the createDate to set
     */
    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    /**
     * @param lastModifyDate the lastModifyDate to set
     */
    public void setLastModifyDate(Date lastModifyDate) {
        this.lastModifyDate = lastModifyDate;
    }

    /**
     * @param creatorId the creatorId to set
     */
    public void setCreatorId(Long creatorId) {
        this.creatorId = creatorId;
    }

    /**
     * @param lastOperatorId the lastOperatorId to set
     */
    public void setLastOperatorId(Long lastOperatorId) {
        this.lastOperatorId = lastOperatorId;
    }

    /**
     * @param departmentId the departmentId to set
     */
    public void setDepartmentId(Long departmentId) {
        this.departmentId = departmentId;
    }

    /**
     * @param hrStatus the hrStatus to set
     */
    public void setHrStatus(Long hrStatus) {
        this.hrStatus = hrStatus;
    }

    /**
     * @param boardDate the boardDate to set
     */
    public void setBoardDate(Date boardDate) {
        this.boardDate = boardDate;
    }

    /**
     * @param supplierId the supplierId to set
     */
    public void setSupplierId(Long supplierId) {
        this.supplierId = supplierId;
    }

    /**
     * @param drivingAge the drivingAge to set
     */
    public void setDrivingAge(Long drivingAge) {
        this.drivingAge = drivingAge;
    }

    /**
     * @param contractParty the contractParty to set
     */
    public void setContractParty(String contractParty) {
        this.contractParty = contractParty;
    }

    /**
     * @param drivingType the drivingType to set
     */
    public void setDrivingType(String drivingType) {
        this.drivingType = drivingType;
    }

    /**
     * @param idFrontPhoto the idFrontPhoto to set
     */
    public void setIdFrontPhoto(String idFrontPhoto) {
        this.idFrontPhoto = idFrontPhoto;
    }

    /**
     * @param idBackPhoto the idBackPhoto to set
     */
    public void setIdBackPhoto(String idBackPhoto) {
        this.idBackPhoto = idBackPhoto;
    }

    /**
     * @param license the license to set
     */
    public void setLicense(String license) {
        this.license = license;
    }

    /**
     * @param thirdAuthentication the thirdAuthentication to set
     */
    public void setThirdAuthentication(String thirdAuthentication) {
        this.thirdAuthentication = thirdAuthentication;
    }

    /**
     * @param avatar the avatar to set
     */
    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    /**
     * @param status the status to set
     */
    public void setStatus(DriverAuditStatus status) {
        this.status = status;
    }

    /**
     * @param isDvl the isDvl to set
     */
    public void setIsDvl(Boolean isDvl) {
        this.isDvl = isDvl;
    }

    /**
     * @param dvlLastUpdateDate the dvlLastUpdateDate to set
     */
    public void setDvlLastUpdateDate(Date dvlLastUpdateDate) {
        DvlLastUpdateDate = dvlLastUpdateDate;
    }
}
